<script setup lang="ts">
  import BorderBox13 from "@/components/datav/border-box-13";
  import { ElButton } from "element-plus";
  import { ref } from "vue";
  const props = withDefaults(
    defineProps<{
      // 标题
      title: number | string;
    }>(),
    {
      title: "",
    }
  );

  const activeButton = ref("整改评估结果"); // 默认选中的按钮
  const selectButton = (button: string) => {
    console.log(1111)
    activeButton.value = button;
  };
</script>

<template>
  <BorderBox13>
    <div class="item_title" v-if="title !== ''">
      <div class="zuo">
          <img class="xmimg" src="@/assets/zhenggai.png" alt="xm">
      </div>
      <span class="title-inner"> &nbsp;&nbsp;{{ title }}&nbsp;&nbsp; </span>
      <!-- <div class="you"></div> -->
    </div>
    <div class="button-change">
      <el-button-group class="button-groupw">
        <el-button
          :class="{ active: activeButton === '整改自评结果' }"
          @click="selectButton('整改自评结果')"
          type="primary"
          plain
        >
        整改自评结果
        </el-button>
        <el-button
          :class="{ active: activeButton === '整改评估结果' }"
          @click="selectButton('整改评估结果')"
          type="primary"
          plain
        >
        整改评估结果
        </el-button>
      </el-button-group>
    </div>
    <div
      :class="title !== '' ? 'item_title_content' : 'item_title_content_def'"
    >
      <slot></slot></div
  ></BorderBox13>
</template>

<style scoped lang="scss">
$item-title-height: 38px;
$item_title_content-height: calc(100% - 38px);

.button-change {
  display: flex;
  justify-self: end;
  position: relative;
  top: -23px; /* 向上移动5px */
}
.xmimg{
  position: absolute;
  top: 60%;
  left: 2%;
}
.item_title {
  height: $item-title-height;
  line-height: $item-title-height;
  width: 100%;
  color: #31abe3;
  text-align: center;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;

  .zuo,
  .you {
    width: 58px;
    height: 14px;
  }

  .you {
    transform: rotate(180deg);
  }
  .title-inner {
    position: absolute;
    top: 35%;
    left: 7%;
    font-weight: 900;
    font-size: 20px;
    letter-spacing: 2px;
    // background: linear-gradient(
    //   92deg,
    //   #0072ff 0%,
    //   #00eaff 48.8525390625%,
    //   #01aaff 100%
    // );
    background-color: #333;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-right: 222px;
  }
}

:deep(.dv-border-box-content)  {
    box-sizing: border-box;
    padding: 6px 16px 0px;
  }

.item_title_content {
  height: $item_title_content-height;
}

.item_title_content_def {
  width: 100%;
  height: 100%;
}

.button-change .el-button {
  z-index: 10;
  border-color: red;
  color: red;
  background-color: white;
}

.button-change .el-button.active {
  
  background-color: red;
  color: white;
}
.el-button-group.button-groupw {
    margin-left: 230px;
}
</style>
